package com.petter.gradlespringboot;

import com.petter.gradlespringboot.entity.Person;
import com.petter.gradlespringboot.entity.User;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cglib.core.DebuggingClassWriter;
import org.springframework.context.ConfigurableApplicationContext;
import org.springframework.web.bind.annotation.RequestMapping;

/**
 * @author GD
 */
@SpringBootApplication
public class GradleSpringBootApplication {

    public static void main(String[] args) {
        System.setProperty(DebuggingClassWriter.DEBUG_LOCATION_PROPERTY, "D:\\code\\dev\\gradleSpringBoot\\build\\runClass");
        ConfigurableApplicationContext context = SpringApplication.run(GradleSpringBootApplication.class, args);
        User user = (User) context.getBean("user");
        System.out.println(user);
        Person person = (Person) context.getBean("person");
        System.out.println(context.getBean("user1"));
        System.out.println(person);
    }

    @RequestMapping("/index")
    public String index(){


        return "this is a index page result !" ;

    }



}
